Skip to content

Stream the OpenAPI preview for Graph-sized spec selections - #1751

Merged
RhysSullivan merged 3 commits into
mainfrom
openapi-graph-preview-streaming
Aug 26, 2026
Merged

Stream the OpenAPI preview for Graph-sized spec selections#1751
RhysSullivan merged 3 commits into
mainfrom
openapi-graph-preview-streaming

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Previewing an OpenAPI integration with a spec-format selection (the Microsoft Graph preset URLs) parsed the 43MB Graph source whole. That builds a ~300MB tree, kills the 128MB Workers isolate mid-request, and surfaces in the add dialog as `Couldn't load or parse this spec` with an empty 503 behind it (trace `6af4828926a96ee93f9a608c7042e747`, 2026-08-26). The add/update path already streams via `structuralSplit`; the preview path did not.

  • `previewSpecTextStreaming`: streaming twin of `previewSpecText` on the same structural-split primitive — head + schema-free components parse small, path-items parse one at a time through `keepPathItem`, and only the top-ranked health-check candidates get their response schemas walked, against the transitive `$ref` closure instead of the full schema map. `previewSpec` and the addSpec derived-preview branch on `resolved.keepPathItem`, so headless adds take the same path.
  • Whole-document parses are now guarded by parsed-tree size: block YAML by line count (structure density is what OOMs — a 36MB flat-scalar doc still parses), JSON by text size, plus a coarse any-shape text ceiling enforced before download via Content-Length. Oversized generic specs get an actionable error instead of taking down the isolate.

Verified against the real 43MB Graph spec under a 160MB heap: mail preset previews 290 ops in ~0.8s at 129MB peak; the default 12-workload bundle previews 6,350 ops in ~1.0s at 154MB; the old whole-parse path now fails cleanly (`964,402 lines, limit 400,000`) instead of dying. Parity between streaming and whole-document previews is pinned by test on a shared fixture.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud fcbfe50 Aug 26 2026, 04:46 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing fcbfe50 Commit Preview URL

Branch Preview URL
Aug 26 2026, 04:44 AM

@github-actions

github-actions Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Aug 26, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1751

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1751

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1751

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1751

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1751

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1751

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1751

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1751

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1751

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1751

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1751

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1751

executor

npm i https://pkg.pr.new/executor@1751

commit: fcbfe50

@RhysSullivan
RhysSullivan marked this pull request as ready for review August 26, 2026 05:22
@RhysSullivan
RhysSullivan merged commit 0007474 into main Aug 26, 2026
77 of 80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant